package com.tengfei.main.course.mapper;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tengfei.common.core.mapper.BaseMapperPlus;
import com.tengfei.main.course.domain.Course;
import com.tengfei.main.course.domain.vo.CourseVo;
import com.tengfei.main.user.domain.SearchEntity;
import com.tengfei.main.user.domain.vo.course.UserCourseVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 课程Mapper接口
 *
 * @author ruoyi
 * @date 2022-07-27
 */
public interface CourseMapper extends BaseMapperPlus<CourseMapper, Course, CourseVo> {

    /**
     * 热门
     *
     * @param size
     * @return
     */
    List<UserCourseVo> selectHotAndViewCount(@Param("size") Integer size);

    /**
     * 最新
     *
     * @param size
     * @return
     */
    List<UserCourseVo> selectNewAndViewCount(@Param("size") Integer size);

    /**
     * 查询用户公开课程课程列表
     * @param search 查询参数
     * @param page 分页参数
     * @return
     */
    Page<UserCourseVo> selectUserCourseList(@Param("search") SearchEntity search, Page<UserCourseVo> page);

}
